Skip to content

Conversation

@lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Nov 17, 2025

Prerequisites checklist

What is the purpose of this pull request?

In this PR, I've resolved the issue metioned in #310.

I've updated the data property to accept string | number | boolean | bigint | null | undefined and added test cases to ensure it works.

What changes did you make? (Give an overview)

In this PR, I've resolved the issue metioned in #310.

Related Issues

Closes: #310

Is there anything you'd like reviewers to focus on?

N/A

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Nov 17, 2025
@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Nov 17, 2025
@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Nov 17, 2025
@lumirlumir lumirlumir moved this from Implementing to Needs Triage in Triage Nov 20, 2025
@lumirlumir lumirlumir marked this pull request as ready for review November 20, 2025 14:01
@lumirlumir lumirlumir requested a review from a team November 20, 2025 14:02
@lumirlumir
Copy link
Member Author

It seems that the CI failure is unrelated to this change.

@lumirlumir
Copy link
Member Author

lumirlumir commented Nov 27, 2025

I investigated this and it appears to be a regression in @modelcontextprotocol/[email protected], released yesterday. Version 1.23.0 added support for Zod v4, which seems to have caused errors in eslint/mcp.

I tried addressing it but couldn't find a clear solution, so I opened an issue in the @modelcontextprotocol/sdk repo: modelcontextprotocol/typescript-sdk#1180

@lumirlumir lumirlumir force-pushed the fix-make-the-data-property-stricter branch from 1789094 to 440b8c2 Compare November 27, 2025 08:50
@lumirlumir
Copy link
Member Author

Marking it as a draft until #332 is merged.

@lumirlumir lumirlumir marked this pull request as draft November 28, 2025 07:11
@lumirlumir lumirlumir marked this pull request as ready for review December 3, 2025 13:01
Copilot AI review requested due to automatic review settings December 3, 2025 13:01
@lumirlumir
Copy link
Member Author

This PR is now ready for re-review.

Copilot finished reviewing on behalf of lumirlumir December 3, 2025 13:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restricts the data property type in violation reports and suggestions from the overly permissive Record<string, unknown> to a new stricter type MessagePlaceholderData that only allows primitive types: string | number | boolean | bigint | null | undefined. This prevents non-serializable types (objects, arrays, functions, symbols, etc.) from being used in message placeholders, which is important since these values are typically converted to strings for display in error messages.

  • Introduced MessagePlaceholderData type to enforce strict typing on message placeholder data
  • Updated both ViolationReportBase and SuggestedEditBase interfaces to use the new type
  • Added comprehensive type tests to verify allowed primitives work correctly and disallowed types (objects, arrays, functions, symbols, maps, sets) are properly rejected at compile time

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/types.ts Defines new MessagePlaceholderData type and updates data property types in ViolationReportBase and SuggestedEditBase interfaces
packages/core/tests/types/types.test.ts Adds comprehensive test coverage for allowed primitive types and uses @ts-expect-error to verify disallowed complex types are properly rejected

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Would like another review before merging.

@nzakas nzakas moved this from Implementing to Second Review Needed in Triage Dec 3, 2025
Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fasttime fasttime merged commit 26e6a50 into main Dec 4, 2025
25 checks passed
@fasttime fasttime deleted the fix-make-the-data-property-stricter branch December 4, 2025 09:39
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Dec 4, 2025
@github-actions github-actions bot mentioned this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted bug Something isn't working

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Change Request: Make the data property stricter

5 participants